package com.xuwang.mapper;

import com.xuwang.Util.TableResult;
import com.xuwang.pojo.Comment;
import com.xuwang.pojo.Restaurant;
import com.xuwang.pojo.RestaurantFood;
import com.xuwang.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (Restaurant)表数据库访问层
 *
 * @author smallseven
 * @since 2021-08-31 15:29:53
 * @version 1.0
 */
@Repository
public interface RestaurantMapper {


    User findIdentityByName(String username);

    User findRestaurantByUserId(int id);

    List<Restaurant> findRestaurantById(@Param("list") List<Integer> ids);

    List<String> findAllFoodKind(@Param("list")List<Integer> idList);

    List<Restaurant> findAllRestaurant();

    List<RestaurantFood> findAllFood();

    int findCountOfComment(Integer id);

    Double findAvgOfComment(Integer id);

    int insertFood(@Param("restaurantFood") RestaurantFood restaurantFood,@Param("restaurant_id") int id);

    int findFoodKindByName(String foodKind);

    int insertComment(Comment comment);

    int findRestaurantIdByUserId(int id);

    List<User> showMyInfo(int id);

    RestaurantFood showOneFood(Integer id);

    List<Comment> findCommentOfFood(Integer id);

    int uploadFoodInfo(@Param("id")Integer id,@Param("src") String src);

    int uploadFoodOtherInfo(RestaurantFood restaurantFood);

    int uploadRestaurantInfo(@Param("id")Integer id,@Param("src") String src);

    int uploadRestaurantOtherInfo(Restaurant restaurant);
}
